# Maintainer: Simon Rupf <simon@rupf.net>
pkgname=convert2json
pkgver=0.8.2
pkgrel=0
pkgdesc="Utilities to convert CSV, INI, TOML, XML & YAML to JSON, including jq/jaq wrappers."
url="https://github.com/simonrupf/convert2json"
arch="all"
license="MIT"
depends="jaq"
makedepends="
	cargo
	cargo-auditable
	clang15-dev
	"
source="https://github.com/simonrupf/convert2json/archive/$pkgver/convert2json-$pkgver.tar.gz"
options="net"

prepare() {
	default_prepare

	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build --release --frozen
}

check() {
	cargo test --frozen
}

package() {
	install -Dm755 target/release/cq target/release/tq target/release/xq \
	    target/release/yq target/release/csv2json target/release/toml2json \
	    target/release/xml2json target/release/yaml2json \
		-t "$pkgdir"/usr/bin
}

sha512sums="
40e21178f740a2806c6efe20c3e61ef2f2ee097273cf0e78a8cf87dc90eaf395a07241d01359a64087c53fc2be92655003592a1f2dd2a90eba273777a34902e5  convert2json-0.8.2.tar.gz
"
